package cn.tedu;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;

public class Demo07 {
    public static void main(String[] args) {
        try(Connection conn = DBUtils.getConn()){
            Statement s = conn.createStatement();
            ResultSet resultSet = s.executeQuery("select * from hero");
            while (resultSet.next()) {
                int id = resultSet.getInt(1);
                String name = resultSet.getString(2);
                int money = resultSet.getInt(3);
                System.out.println(id + "," + name + "," + money);
            }
        }catch (Exception e) {
            e.printStackTrace();
        }
    }
}
